import type { BasicFetchResult, BasicPageParams } from './baseModel';

export interface ArticleColumnRecord {
  id: number;
  name: string;
  icon: string;
}

export type ArticleColumnListResultModel = ArticleColumnRecord[];

export interface AdvertsRecord {
  id: string | number;
  url: string;
  picture: string;
}

export type AdvertsGetResultModel = AdvertsRecord[];

export interface BannerRecord {
  id: number | string;
  avatar: string;
  cover_image: string;
  title: string;
  brief_content: string;
  time: string;
  like: number;
  collect: number;
  replay: number;
  view: number;
  read: number;
  read_time: number;
  name: string;
  tags: string[];
}

export type BannersGetResultModel = BannerRecord[];

export interface ArticleRecord {
  /** 栏目 id */
  column_id: number;
  /** 内容 */
  content: string;
  /** 头像 */
  cover: string;
  /** 创建时间 */
  createTime: string;
  /** 收藏 */
  favorites: number;
  /** 文章 id */
  id: number;
  /** 点赞 */
  likes: number;
  /** 已读 */
  read: number;
  /** 评论数 */
  recommend: number;
  /** 状态 */
  state: number;
  /** 标签 id */
  tag_id: string;
  /** 标题 */
  title: string;
  /** 更新时间 */
  updateTime: string;
  /** 作者 id */
  user_id: number;
  /** 作者 头像*/
  user_icon: string;
  /** 作者 名字*/
  user_name: string;
  /** 标签 */
  tag: string;
  /** 内容 */ FollowListResultModel;
  brief: string;

  comment_count: number;
}

export type ArticleListResultModel = BasicFetchResult<ArticleRecord>;

export type ArticleResultModel = ArticleRecord[];

export interface FollowRecord {
  id: number;
  icon: string;
  name: string;
  follower: string;
  introduce: string;
  is_following: boolean;
}

export type FollowListResultModel = FollowRecord[];

export interface ArticleListParams {
  column_id: string;
  page: number;
  size: number;
  user_id?: number;
  sp_column_id?: number;
}
export type ArticlePageParams = Partial<Pick<ArticleRecord, 'column_id'>> & BasicPageParams;

export interface ArticleTagRecord {
  id: number;
  name: string;
}

export type ArticleTagListResultModel = ArticleTagRecord[];
